import { RouteRecordRaw } from "vue-router";

/***
 * 主要的路由数组，在这个地方定义的路由页面相当于是受layout控制
 *
 */
export const dynamicRoutes: Array<RouteRecordRaw> = [
  {
    path: "/",
    name: "home",
    component: () => import("/@/layout/index.vue"),
    redirect: "/experiment",
    children: [
      {
        name: "experiment",
        path: "experiment",
        redirect: "/experiment/list",
        children: [
          {
            path: "list",
            name: "experimentList",
            component: () => import("/@/views/experiment/list.vue"),
            meta: {
              iskeepAlive: true,
            },
          },
          {
            path: "editRegentBoard",
            name: "editRegentBoard",
            component: () => import("/@/views/experiment/edit-reagent-board.vue"),
            meta: {
              iskeepAlive: true,
            },
          },
        ],
      },
      {
        name: "reagent",
        path: "reagent",
        redirect: "/reagent/list",
        children: [
          {
            path: "list",
            name: "reagentList",
            component: () => import("/@/views/reagent/list.vue"),
            meta: {
              iskeepAlive: true,
            },
          },
        ],
      },
      {
        name: "template",
        path: "template",
        redirect: "/template/list",
        children: [
          {
            path: "list",
            name: "templateList",
            component: () => import("/@/views/template/list.vue"),
            meta: {
              iskeepAlive: true,
            },
          },
        ],
      },
      {
        name: "settings",
        path: "settings",
        redirect: "/settings/list",
        children: [
          {
            path: "list",
            name: "settingsList",
            component: () => import("/@/views/settings/index.vue"),
            meta: {
              iskeepAlive: true,
            },
          },
        ],
      },
    ],
  },
];

/**
 * 定义静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    name: "login",
    component: () => import("/@/views/login/login-account.vue"),
  },
];
/**
 * 定义错误路由
 */
export const notFoundAndNoPower = [
  {
    path: "/:path(.*)*",
    name: "notFound",
    component: () => import("/@/views/error/error-404.vue"),
  },
  {
    path: "/500",
    name: "error500",
    component: () => import("/@/views/error/error-500.vue"),
  },
];
